package com.andaily.domain.dto.log;

import com.andaily.domain.log.Log;
import com.andaily.domain.log.LogComment;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Shengzhao Li
 */
public class LogDetailsDto extends LogDto {

    private List<LogCommentDto> comments = new ArrayList<LogCommentDto>();

    public LogDetailsDto() {
    }

    public LogDetailsDto(Log log) {
        super(log);

        final List<LogComment> logComments = log.logComments();
        for (LogComment logComment : logComments) {
            comments.add(new LogCommentDto(logComment));
        }
    }

    public List<LogCommentDto> getComments() {
        return comments;
    }

    public void setComments(List<LogCommentDto> comments) {
        this.comments = comments;
    }
}
